$(document).ready(function () {

    $("#submit").click(function () {

        $("#index-form").validate({
            submitHandler:function (form) {

                var urlPath = "/query"
                $(form).ajaxSubmit({
                    url:urlPath,
                    type:"get",
                    dataType:"json",
                    //成功
                    success:function (data,status) {
                        if (data.Id==0){
                            document.getElementById("id").value = "无"
                            document.getElementById("name").value = "无"
                            document.getElementById("producer").value = "无"
                            document.getElementById("createdate").value = "无"
                        }else {
                            document.getElementById("id").value = data.Id
                            document.getElementById("name").value = data.Name
                            document.getElementById("producer").value = data.Producer
                            document.getElementById("createdate").value = data.Createdate
                        }
                    }

                })

            }
        })

    })

})